import App from './App'
import uviewPlus from 'uview-plus'
import { jsonp } from 'vue-jsonp'


// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
Vue.use(jsonp) // Vue2正常注册
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  app.use(uviewPlus)
  // 关键修改：Vue3环境下手动挂载全局jsonp方法
  app.config.globalProperties.$jsonp = jsonp
  app.config.globalProperties.getImagePath = function(path) {
  	// 正式服OSS
  	return '/static' + path;
  }
  return {
    app
  }
}
// #endif